package org.jctc.els.modules.biz.mapper.elsTeamMembers;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.jctc.els.modules.biz.entity.elsTeamMembers.ElsTeamMembers;
import org.jctc.els.modules.biz.vo.ElsTeamMembersVO;

import java.util.Arrays;
import java.util.List;

@Mapper
public interface ElsTeamMembersMapper extends BaseMapper<ElsTeamMembers> {
    int selectUserAlreadyExists(@Param("userId")  Long userId, @Param("teamId")  Long teamId);

    List<ElsTeamMembersVO> getExpertsList(IPage<ElsTeamMembersVO> page, @Param("teamId") String teamId);

    void removeList(@Param("id") Long id);

    boolean updateLeader(@Param("id") String id,@Param("canLeader") Integer canLeader);

    ElsTeamMembers selectUserLeader(@Param("teamId") String teamId);

    /**
     * 删除小组成员
     * @param teamId
     * @param userIds
     * @return
     */
    int removeTeamMembers(@Param("teamId") Long teamId,
                          @Param("userIds") List<Long> userIds);

    List<ElsTeamMembers> selectTeamList(@Param("id") String id);
}